one = 1
two = 2
three = 3

#  a = dict(one,two,three) 这样写有报错
ab = zip(['one', 'two', 'three'], [1, 2, 3])
print(ab)

d = dict([('two', 2), ('one', 1), ('three', 3)])
#注意下面的写法会报错，传入了3个参数，而上面的写法是传入了一个列表，列表中有三个元素
#   d = dict(('two', 2), ('one', 1), ('three', 3))

dict([(2,'one')])

d1 = [ (86, 'China'),
 (91, 'India'),
 (1, 'United States'),
 (62, 'Indonesia'),
 (55, 'Brazil'),
 (92, 'Pakistan'),
 (880, 'Bangladesh'),
 (234, 'Nigeria'),
 (7, 'Russia'),
 (81, 'Japan'),
]
cccc = dict(d1)
print(cccc)
print(cccc.items())
#列表推导式
ccca = {country:code for code,country in cccc.items()}
print(ccca)

#思路：当一个列表要交换键与值时，可以用字典推导式构建